package com.distribution.system.utils.convert;

import java.lang.reflect.Field;
import java.security.PrivilegedAction;

/**
 * @author huoliping
 * @description
 * @date 2021-05-06 17:23
 **/
public final class GetDeclaredFields implements PrivilegedAction<Field[]> {
    private final Class<?> clazz;

    public static GetDeclaredFields action(Object obj) {
        return new GetDeclaredFields(obj);
    }

    private GetDeclaredFields(Object obj) {
        this.clazz = obj.getClass();
    }

    @Override
    public Field[] run() {
        return clazz.getDeclaredFields();
    }
}